package com.lzb.common.exception;

public class ServiceException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 
	 */

	private String errorCode;// 错误代码
	private String errorMessage;// 错误信息描述
	private Object errorPayload;// 发生异常时的报文体信息，可为org.springframework.integration.Message<?>.getPayload()

	public ServiceException() {
		super();
	}

	public ServiceException(String errorCode, String errorMessage) {
		super();
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}

	public ServiceException(String errorCode, String errorMessage, String message) {
		super(message);
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}

	public ServiceException(String errorCode, String errorMessage, String message, Throwable cause) {
		super(message, cause);
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}

	public ServiceException(String errorCode, String errorMessage,
			Object errorPayload) {
		super();
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
		this.errorPayload = errorPayload;
	}

	public ServiceException(String message, Throwable cause,
			boolean enableSuppression, boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}

	public ServiceException(String message, Throwable cause) {
		super(message, cause);
	}

	public ServiceException(String message) {
		super(message);
	}

	public ServiceException(Throwable cause) {
		super(cause);
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public Object getErrorPayload() {
		return errorPayload;
	}

	public void setErrorPayload(Object errorPayload) {
		this.errorPayload = errorPayload;
	}

}
